package com.gjy.mysql.util;

import java.util.Collection;
import java.util.Map;

/**
 * @author 宫静雨
 * @version 1.0
 * @since 2022-11-18 11:19:33
 */
public class ObjectUtil {

    public static <T> boolean isEmpty(T t) {
        if (t instanceof Collection) {
            return ((Collection<?>) t).isEmpty();
        } else if (t instanceof Map) {
            return ((Map<?, ?>) t).isEmpty();
        } else if (t instanceof String) {
            return ((String) t).isEmpty();
        } else {
            return null == t;
        }
    }
}
